x86/vmx: correctly gather gs_shadow value for current vCPU
authorTamas K Lengyel <tamas@tklengyel.com>
Thu, 6 Jun 2019 12:07:54 +0000 (14:07 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 6 Jun 2019 12:07:54 +0000 (14:07 +0200)
commit18af067ae3c2b12b4330e495ce471cc51d3c3f5a
tree1ebdce34e78439cfa0800cafa03d0617ad50c022
parentec821f1242d2e6eef25e81fc49ebd8fbe9118a92
x86/vmx: correctly gather gs_shadow value for current vCPU

Currently the gs_shadow value is only cached when the vCPU is being scheduled
out by Xen. Reporting this (usually) stale value through vm_event is incorrect,
since it doesn't represent the actual state of the vCPU at the time the event
was recorded. This prevents vm_event subscribers from correctly finding kernel
structures in the guest when it is trapped while in ring3.

Refresh shadow_gs value when the context being saved is for the current vCPU.

Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
master commit: f69fc1c2f36e8a74ba54c9c8fa5c904ea1ad319e
master date: 2019-05-13 09:55:59 +0200
xen/arch/x86/hvm/vmx/vmx.c